//
//  UIViewController+HttpRequest.h
//  CarJX
//
//  Created by King-ChenXu on 14-9-7.
//  Copyright (c) 2014年 KK. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <AFNetworking.h>
#import <JSONModel.h>
#import <UIView+Toast.h>

//http://192.168.1.201:8080/shopi/mobile/interface.do


@interface ResultMy : JSONModel {
 }

@property (nonatomic,strong) NSString *type;
@property (nonatomic,strong) NSString *flag;
@property (nonatomic,assign) int error;
@property (nonatomic,strong) id<Optional> info;

-(NSDictionary *)dictionaryInfo;


@end

const static NSInteger CarJXUnkownDataErrorCode = 111;
@interface AFJSONResponseSerializer (Custom)

@end


@interface UIViewController (HttpRequest)


-(void) GET:(NSString *) urlStr params:(NSDictionary *) params success:(void(^)(ResultMy *result))success ;

-(void) GET:(NSString *) urlStr params:(NSDictionary *) params success:(void(^)(ResultMy *result))success failure:(void(^)(NSError *error))failure;
-(void)GETWithGasonContentType:(NSString *)type params:(NSDictionary *)params success:(void (^)(ResultMy *))success failure:(void (^)(NSError *))failure
;
-(void) GETWithContentType:(NSString *) type params:(NSDictionary *) params success:(void(^)(ResultMy *result))success;
-(void) GETWithContentType:(NSString *) type params:(NSDictionary *) params success:(void(^)(ResultMy *result))success failure:(void(^)(NSError *error))failure;
-(void)GETWithContentHelpType:(NSString *)type params:(NSDictionary *)params success:(void (^)(ResultMy *result))success failure:(void (^)(NSError *error))failure;
@end
